home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / 2.01 sources / Library-2.01 / Interfaces / CommResources.lisp next >
Encoding:
Text File  |  1993-09-16  |  4.6 KB  |  177 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :traps)             ; 
  3. ;     CommResources.p
  4. ;     Pascal Interface to the Communications Resource Manager
  5. ;     
  6. ;     Copyright © Apple Computer, Inc. 1988-90
  7. ;     All rights reserved
  8.  
  9. ;;;;;;;;;;;;;
  10. ;
  11. ; Modification History
  12. ;
  13. ; 04/28/93 mwp Release
  14. ; 10/07/92 bill #_initcrm now returns a result code.
  15. ;
  16.  
  17. ; $IFC UNDEFINED UsingIncludes
  18. ; $SETC UsingIncludes := 0
  19. ; $ENDC
  20.  
  21. ; $IFC NOT UsingIncludes
  22.  
  23. ; $ENDC
  24.  
  25. ; $IFC UNDEFINED UsingCommResources
  26. ; $SETC UsingCommResources := 1
  27.  
  28. ; $I+
  29. ; $SETC CommResourcesIncludes := UsingIncludes
  30. ; $SETC UsingIncludes := 1
  31. ; $IFC UNDEFINED UsingOSUtils
  32.  
  33. (require-interface 'OSUTILS)    ; $I $$Shell(PInterfaces)OSUtils.p
  34. ; $ENDC
  35.  
  36. ; $SETC UsingIncludes := CommResourcesIncludes
  37.  
  38. ;     current version of the CRM 
  39. (defconstant $curCRMVersion 2)
  40.  
  41. ;     tool classes (also the tool file types)    
  42. (defconstant $classCM :|cbnd|)
  43. (defconstant $classFT :|fbnd|)
  44. (defconstant $classTM :|tbnd|)
  45.  
  46. ;     constants general to the use of the Communications Resource Manager 
  47. (defconstant $crmType 9)        ; queueType
  48. (defconstant $crmRecVersion 1)  ; version of queue data structure
  49.  
  50. ;     error codes 
  51. (defconstant $crmGenericError -1)
  52. (defconstant $crmNoErr 0)
  53.  
  54. ;     data structures general to the use of the Communications Resource Manager 
  55. (def-mactype :crmerr (find-mactype :signed-integer))
  56.  
  57. (def-mactype :crmrecptr (find-mactype :pointer))
  58. (defrecord CRMRec 
  59.    (qLink (:pointer :qelem))    ; reserved
  60.    (qType :signed-integer)      ; queue type -- ORD(crmType) = 9
  61.    (crmVersion :signed-integer) ; version of queue element data structure
  62.    (crmPrivate :signed-long)    ; reserved
  63.    (crmReserved :signed-integer); reserved
  64.  
  65.    (crmDeviceType :signed-long) ; type of device, assigned by DTS
  66.    (crmDeviceID :signed-long)   ; device ID; assigned when CRMInstall is called
  67.    (crmAttributes :signed-long) ; pointer to attribute block
  68. ; device specific
  69.    (crmStatus :signed-long)     ; status variable - device specific
  70.  
  71.    (crmRefCon :signed-long)     ; for device private use
  72.    )
  73.  
  74.  
  75. (defctbtrap _initcrm () 
  76.   #x0501
  77.   :signed-integer)
  78.  
  79. (defctbtrap _crmgetheader () 
  80.   #x0502 
  81.   (:pointer :qhdr))
  82.  
  83. (defctbtrap _crminstall ((crmreqptr (:pointer :qelem))) 
  84.   #x0503)
  85.  
  86. (defctbtrap _crmremove ((crmreqptr (:pointer :qelem))) 
  87.   #x0504 
  88.   :oserr)
  89.  
  90. (defctbtrap _crmsearch ((crmreqptr (:pointer :qelem))) 
  91.   #x0505 
  92.   (:pointer :qelem))
  93.  
  94. (defctbtrap _crmgetcrmversion () 
  95.   #x0506 
  96.   :integer)
  97.    
  98. (defctbtrap _crmgetresource ((thetype :ostype) 
  99.                              (theid :signed-integer)) 
  100.   #x0507 
  101.   :handle)
  102.  
  103. (defctbtrap _crmget1resource ((thetype :ostype) 
  104.                               (theid :signed-integer)) 
  105.   #x0508 
  106.   :handle)
  107.  
  108. (defctbtrap _crmgetindresource ((thetype :ostype) 
  109.                                 (index :signed-integer)) 
  110.   #x0509
  111.   :handle)
  112.  
  113. (defctbtrap _crmget1indresource ((thetype :ostype) 
  114.                                  (index :signed-integer)) 
  115.   #x050A 
  116.   :handle)
  117.  
  118. (defctbtrap _crmgetnamedresource ((thetype :ostype) 
  119.                                   (name (:string 255))) 
  120.   #x050B
  121.   :handle)
  122.  
  123. (defctbtrap _crmget1namedresource ((thetype :ostype) 
  124.                                    (name (:string 255))) 
  125.   #x050C 
  126.   :handle)
  127.  
  128. (defctbtrap _crmreleaseresource ((thehandle :handle)) 
  129.   #x050D)
  130.  
  131. (defctbtrap _crmgetindex ((thehandle :handle)) 
  132.   #x050E
  133.   :signed-long)
  134.  
  135. (defctbtrap _crmlocaltorealid ((bundletype :ostype) 
  136.                                (toolid :signed-integer) 
  137.                                (thekind :ostype) 
  138.                                (localid :signed-integer))
  139.   #x050F
  140.   :integer)
  141.  
  142. (defctbtrap _crmrealtolocalid ((bundletype :ostype) 
  143.                                (toolid :signed-integer) 
  144.                                (thekind :ostype) 
  145.                                (realid :signed-integer)) 
  146.   #x0510 
  147.   :handle)
  148.    
  149. (defctbtrap _crmgetindtoolname ((bundletype :ostype) 
  150.                                 (index :signed-integer) 
  151.                                 (toolname (:pointer (:string 255))))
  152.   #x0511
  153.   :oserr)
  154.  
  155. (defctbtrap _crmfindcommunications ((vrefnum (:pointer :signed-integer)) 
  156.                                     (dirid (:pointer :signed-long)))
  157.   #x0512
  158.   :oserr)
  159.  
  160. (defctbtrap _crmgettoolresource ((procid :signed-integer) 
  161.                                  (thetype :ostype) 
  162.                                  (theid :signed-integer)) 
  163.   #x0513 
  164.   :handle)
  165.  
  166. (defctbtrap _crmreleasetoolresource ((procid :signed-integer) 
  167.                                      (thehandle :handle))
  168.    #x0514)
  169.  
  170. ; $ENDC
  171.  
  172.  
  173. (export '($crmnoerr $crmgenericerror $crmrecversion $crmtype $classtm $classft
  174.           $classcm $curcrmversion))
  175. (provide-interface 'CommResources)
  176.